Skip to content

date: honor narrow width on wide default strftime fields #11660#11670

Merged
cakebaker merged 1 commit intouutils:mainfrom
vishakha1411:fix-date-narrow-width
Apr 6, 2026
Merged

date: honor narrow width on wide default strftime fields #11660#11670
cakebaker merged 1 commit intouutils:mainfrom
vishakha1411:fix-date-narrow-width

Conversation

@vishakha1411
Copy link
Copy Markdown
Contributor

Fixes #11660

For specifiers with a wider default width like %j, uutils stripped default padding when the requested width was smaller, but returned too early.
This change strips the default padding first and then continues through the existing width-padding logic, matching GNU behavior.

The test now passes after the change:
image

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 6, 2026

GNU testsuite comparison:

GNU test failed: tests/timeout/timeout-group. tests/timeout/timeout-group is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/follow-name (passes in this run but fails in the 'main' branch)

@cakebaker cakebaker merged commit 5109470 into uutils:main Apr 6, 2026
168 of 169 checks passed
@cakebaker
Copy link
Copy Markdown
Contributor

Thanks!

@vishakha1411 vishakha1411 deleted the fix-date-narrow-width branch April 6, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

date: strftime strips leading zeros when requested width is narrower than default (%02j on day 1)

2 participants